<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" import="shared.MyDateUtil" errorPage="" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="java.util.List" %>
<%@ page import="shared.PMF" %>
<%@ page import="pk1.*" %>
<%@ page import="java.util.Date"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
</head>

<body>

<table border="1">
<%
PersistenceManager pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(Invite.class);
query.setFilter("inviterd_ID >= 0");
//query.setOrdering("hireDate desc");
//query.declareParameters("String lastNameParam");

try {
    List<Invite> results = (List<Invite>)query.execute();
    if (!results.isEmpty()) {
%>
<tr><td>受邀者</td><td>邀請者</td><td>活動名稱</td><td>受邀者交換條件</td><td>邀請者交換條件</td><td>日期</td><td>留言</td></tr>
<%
        for (Invite inv : results) {
%>
<tr>
<td><%=inv.getInviterdID() %></td>
<td><%=inv.getInviterID() %></td>
<td><%=inv.getInviteActivity() %></td>
<td><%=inv.getInviterdCon() %></td>
<td><%=inv.getInviterCon() %></td>
<td><%=inv.getInviteDate() %></td>
<td><%=inv.getInviteMessage() %></td>
</tr>
<% 
        }// for
    } else {
    	out.println("無邀請資料!");
    }
}catch(ClassCastException e){
	System.out.println(e.getMessage());
}finally {

    query.closeAll();
    pm.close();
}
%>
</table>
</body>
</html>